/**
 * Writed by yura and mak
 */

package wz.legend.handlers.auction;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

@Entity
public class Lot {
    @Id
    private Long id;
    @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
    private Product product;
    private Integer amount;
    private BigDecimal cost;
    private Integer qualityLow;
    private Integer qualityHi;
    private Date date;

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the product
     */
    public Product getProduct() {
        return product;
    }

    /**
     * @param product
     *            the product to set
     */
    public void setProduct(Product product) {
        this.product = product;
    }

    /**
     * @return the cost
     */
    public BigDecimal getCost() {
        return cost;
    }

    /**
     * @param cost
     *            the cost to set
     */
    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }

    /**
     * @return count of product
     */
    public Integer getAmount() {
        return amount;
    }

    /**
     * @param amount
     *            count of product
     */
    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getQualityLow() {
        return qualityLow;
    }

    public void setQualityLow(Integer qualityLow) {
        this.qualityLow = qualityLow;
    }

    public Integer getQualityHi() {
        return qualityHi;
    }

    public void setQualityHi(Integer qualityHi) {
        this.qualityHi = qualityHi;
    }
    
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this).append("product", product).append(
                "id", id).append("amount", amount).append("cost", cost).append(
                "qualityHi", qualityHi).append("qualityLow", qualityLow)
                .toString();
    }

}
